import matplotlib.pyplot as plt
import numpy as np

# 创建示例数据
x = np.linspace(0, 10, 100)
y1 = np.sin(x)
y2 = np.cos(x)

# 绘制多条曲线并添加名称
plt.plot(x, y1, label='sin(x)')
plt.plot(x, y2, label='cos(x)')

# 添加图例
plt.legend()

# 添加标题和坐标轴标签
plt.title('Multiple Curves with Names')
plt.xlabel('x')
plt.ylabel('y')

# 显示图形
plt.show()